/**
 * Copyright (c) 2016-2019 ykf All rights reserved.
 *
 * https://www.renren.io
 *
 * 版权所有，侵权必究！
 */

package com.basic.modules.sys.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.basic.common.annotation.SysLog;
import com.basic.common.exception.RRException;
import com.basic.common.utils.Constant;
import com.basic.common.utils.R;
import com.basic.modules.sys.entity.SysMenuEntity;
import com.basic.modules.sys.service.ShiroService;
import com.basic.modules.sys.service.SysMenuService;
import org.apache.commons.lang.StringUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.*;


/**
 * 系统菜单
 *
 * @author Mark sunlightcs@gmail.com
 */
@RestController
@RequestMapping("/sys/menu")
public class SysMenuController extends AbstractController {

	@Autowired
	private SysMenuService sysMenuService;

	@Autowired
	private ShiroService shiroService;

	/**
	 * 导航菜单
	 */
	@GetMapping("/nav")
	public R nav(){
		return R.ok(sysMenuService.getUserMenuList(getUserId()));
	}

	/**
	 * 获取所有的菜单
	 */
	@PostMapping("/menuList")
	public R menuList(){
		return R.ok(sysMenuService.getUserMenuList(getUserId()));
	}
}